home *** CD-ROM | disk | FTP | other *** search
- #define CURSES_LIBRARY 1
- #include <curses.h>
-
- #ifdef PDCDEBUG
- char *rcsid__setscrn = "$Header: C:\CURSES\private\RCS\_setscrn.c 2.1 1993/06/18 20:23:49 MH Rel MH $";
- #endif
-
-
-
-
- /*man-start*********************************************************************
-
- PDC_set_scrn_mode() - Set BIOS Video Mode
-
- PDCurses Description:
- Sets the BIOS Video Mode Number ONLY if it is different from
- the current video mode. This routine is for DOS systems only.
-
- PDCurses Return Value:
- This function returns OK on success and ERR on error.
-
- PDCurses Errors:
- No errors are defined for this function.
-
- Portability:
- PDCurses int PDC_set_scrn_mode( int new_mode );
-
- **man-end**********************************************************************/
-
- #ifdef OS2
- int PDC_set_scrn_mode(VIOMODEINFO new_mode)
- #else
- int PDC_set_scrn_mode(int new_mode)
- #endif
- {
- #ifdef DOS
- int cur;
- #endif
-
- #ifdef PDCDEBUG
- if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n");
- #endif
-
- #ifdef FLEXOS
- return( OK );
- #endif
-
- #ifdef DOS
- cur = (int) PDC_get_scrn_mode();
- if (cur != new_mode)
- {
- regs.h.ah = 0x00;
- regs.h.al = (char) new_mode;
- int86(0x10, ®s, ®s);
- }
- _cursvar.font = PDC_get_font();
- _cursvar.scrnmode = new_mode;
- LINES = PDC_get_rows();
- COLS = PDC_get_columns();
- return( OK );
- #endif
-
- #ifdef OS2
- if (VioSetMode (&new_mode, 0) != 0)
- {
- _cursvar.font = PDC_get_font();
- _cursvar.scrnmode = new_mode;
- LINES = PDC_get_rows();
- COLS = PDC_get_columns();
- return( OK );
- }
- else
- return (ERR);
- #endif
-
- #ifdef UNIX
- return(OK); /* this is N/A */
- #endif
- }
-